package com.atguigu.easyexcel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * @author xiaowei
 * @description:
 * @create 2021-12-06-21:49
 */
public class ExcelListener extends AnalysisEventListener<UserData> {
//    一行一行读取excel文件的内容，从第二行开始
    @Override
    public void invoke(UserData userData, AnalysisContext analysisContext) {
        System.out.println(userData);
    }

//    读取之后执行这个方法
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
//    读取表头信息
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头信息"+headMap);
    }
}
